import http from "@/api";
// 对接端口数据
const routers = "myWork";

// 表头
// const Authorization = store.getState().user.token;
// "bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiIzNDkwNTc0MDcyMDk1NDEiLCJyblN0ciI6IjRzcDVINGI4eXdtZXVzSm0xVHNFVG5PWVM2R1kyQklJIiwidXNlcl9pZCI6IjM0OTA1NzQwNzIwOTU0MSIsInVzZXJfbmFtZSI6ImFkbWluIiwic2luZ2xlTG9naW4iOjIsImV4cCI6MTcyMDM5NzI1NzIyOSwidG9rZW4iOiJsb2dpbl90b2tlbl81Nzk2ODE1NjU4MjM0Nzc3NjUifQ.amA435rbetoB4-LhHXKhe6xeRWnGWa502omtqZ2yuoI";

// 我的工作-读取菜单列表
// 注意特殊约定：结果menuId为all的对应全部菜单；为week的对应最近7天菜单；为today的对应今天的菜单
export const getMyWorkMenu = (menuName: string) => {
  return http.get(`/api/finportal/myworkMenu/list`, { menuName }, { baseUrlKey: routers });
};

// 我的工作-菜单更新
// id: string,menuName:string
export const updateMenu = (param: any) => {
  return http.post(`/api/finportal/myworkMenu/update`, { ...param }, { baseUrlKey: routers });
};

// 我的工作-菜单删除
// id:String
export const deleteMenu = (id: string) => {
  return http.post(`/api/finportal/myworkMenu/delete/${id}`, {}, { baseUrlKey: routers });
};

// 我的工作-保存右边列表
// menuId: string,content:string
export const saveMenu = (param: any) => {
  return http.post(`/api/finportal/myworkMenu/save`, { ...param }, {  baseUrlKey: routers });
};

// 我的工作-读取菜单列表
// userId: string,menuId:string
/*传空查询所有
传week查询近7天
传today查询当天
传具体菜单ID查对应菜单的内容*/
export const myworkInfolistMenu = (param: any) => {
  return http.post(`/api/finportal/myworkInfo/list`, { ...param }, { baseUrlKey: routers });
};

// 我的工作-保存右边列表
// menuId: string,content:string
export const myworkInfoSaveMenu = (param: any) => {
  return http.post(`/api/finportal/myworkInfo/save`, { ...param }, {  baseUrlKey: routers });
};

// 我的工作-内容更新 是否完成
// 完成标识 修改内容 二选一
// isFinished:int content:String id:String
export const updateMyworkMenu = (param: any) => {
  return http.post(`/api/finportal/myworkInfo/update`, { ...param }, { baseUrlKey: routers });
};

// 我的工作-内容删除
//
export const deleteMyworkMenu = (id: string) => {
  return http.post(`/api/finportal/myworkInfo/delete/${id}`, { id }, { baseUrlKey: routers });
};

// 我的工作-已完成内容批量删除(三个点那个)
export const deleteFinishedMyworkMenu = () => {
  return http.post(`/api/finportal/myworkInfo/deleteFinished`, {}, {  baseUrlKey: routers });
};
